<!doctype html>
<html lang="en" class="feedback">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
		<link rel="stylesheet" href="../lib/font-awesome-4.7.0/css/font-awesome.min.css">
		<style>
			.word {
				font-size: 16px;
				color: black;
			}
			
			.bigword {
				font-size: 18px;
				color: black;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">用户信息</h1>
		</header>
		<ul class="mui-table-view" style="margin-top: 55px;">
			<li class="mui-table-view-cell">
				<div>
					<div style="width:60px; border:1px solid #95a2ba;height:60px;float:left;"><i class="fa fa-user  mui-pull-left" style="font-size:50px;color:#95a2ba;line-height: 60px;margin-left:11px;"></i></div>
					<div style="float:left;margin-top: 10px;margin-left: 10px;">
						<p class="bigword" id="realname"></p>
						<p id="username">账号:</p>
					</div>

				</div>
			</li>
		</ul>
		<ul class="mui-table-view" style="margin-top: 13px;">
			<li class="mui-table-view-cell">
				<div>
					<p id="phonenum" class="word">手机号码： </p>
				</div>
			</li>
		</ul>

		<ul class="mui-table-view" style="margin-top: 13px;">
			<li class="mui-table-view-cell">
				<div>
					<p id="company" class="word">公司： </p>
				</div>
			</li>
		</ul>

		<ul class="mui-table-view" style="margin-top: 13px;">
			<li id="viewHistory_btn" class="mui-table-view-cell">
				<div>
					<p id="history" class="word">巡查历史<i class="fa fa-angle-right mui-pull-right" style="font-size:20px;color:#95a2ba;margin-right:11px;"></i></p>
				</div>
			</li>
		</ul>
		<ul class="mui-table-view" style="margin-top: 13px;">
			<li class="mui-table-view-cell">
				<div>
					<p id="version" class="word">版本号： </p>
				</div>
			</li>
		</ul>
		<br />
		<div class="title" style="width:100%; height:45px;line-height: 45px;font-size: 18px;margin-top:10px;clear:both;color:white;">
			<div id="logout_btn" style="width:100%; height:100%;float: left;text-align:center;background-color:#179efa;font-family: " Microsoft YaHei ";">退出登录</div>
		</div>
		</div>
		<script src="../lib/mui/mui.min.js" type="text/javascript"></script>
		<script src="../lib/jquery-2.1.0.min.js" type="text/javascript"></script>
		<script src="../js/serviceUrlConfig.js" type="text/javascript"></script>
		<script type="text/javascript">
			function plusReady() {
				var selfInfo = plus.webview.currentWebview();
				plus.navigator.setStatusBarStyle('dark');
				var userInfo = selfInfo.param;

				$("#realname").text(userInfo.username);
				$("#username").text("账号：" + userInfo.logname);
				$("#phonenum").text("手机号码：" + userInfo.phoneNumber);
				$("#company").text("公司：" + userInfo.companyName);


				// 获取本地应用资源版本号
				plus.runtime.getProperty(plus.runtime.appid, function(inf) {
					var wgtVer = inf.version;
					$("#version").text("版本号：" + wgtVer);
				});

				$("#logout_btn").click(function() {
					logout();
				});

				$("#viewHistory_btn").click(function() {
					mui.openWindow({
						url: "./history.html",
						id: "history",
						extras: {
							param: {
								userInfo: userInfo
							}
						},
						styles: {
							popGesture: "close",
							statusbar: {
								background: "#f7f7f7"
							}
						}
					})
				});

			}
			if(window.plus) {
				plusReady();
			} else {
				document.addEventListener('plusready', plusReady, false);
			}

			function logout() {
				var Webview_index = plus.webview.getWebviewById("index.html");
				plus.webview.close(Webview_index);
				var ws2 = plus.webview.getWebviewById("login");
				if(ws2) {
					ws2.reload(true);
				}
				mui.openWindow({
					url: "../login.html",
					id: "login",
					styles: {
						popGesture: "close",
						statusbar: {
							background: "#f7f7f7"
						}
					}

				});
			}
		</script>
	</body>

</html>